//
//  SEPrescriptionOrderDrugCell.swift
//  SmartEyeForPatient
//
//  Created by qdsg on 2021/4/17.
//

import UIKit

class SEPrescriptionOrderDrugCell: UITableViewCell {

    static let className = "SEPrescriptionOrderDrugCell"
    static let reuseId = className

    @IBOutlet weak var stackBgView: UIView! {
        didSet{
            stackBgView.layer.cornerRadius = 4
            stackBgView.layer.borderWidth = 1
            stackBgView.layer.borderColor = Asset.border.color.cgColor
            stackBgView.layer.masksToBounds = true
        }
    }

    @IBOutlet weak var nameLabel: UILabel!
    @IBOutlet weak var unitLabel: UILabel!
    @IBOutlet weak var countLabel: UILabel!
    @IBOutlet weak var useLabel: UILabel!
    @IBOutlet weak var timesLabel: UILabel!
    @IBOutlet weak var timesCountLabel: UILabel!
    @IBOutlet weak var feeLabel: UILabel!

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    func updateData(_ model: SEPrescriptionDrugModel) {
        nameLabel.text = model.name
        unitLabel.text = model.drugSpecification
        useLabel.text = model.drugChannel
        timesLabel.text = model.drugFrequency
        timesCountLabel.text = "1次\(model.drugDose)\(model.dosageUnit)"
        countLabel.text = model.drugNumber + model.baseUnit
        feeLabel.text = String(format: "%.2lf元", model.expense / 100.0)
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
